/**
 *    Copyright (c) 2014-2019 CK.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
package com.github.fartherp.framework.core.kv.handler;

import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * @author CK
 * @date 2015/11/13
 */
public interface KvHandler {
    /**
     * IN条件
     */
	int IN = 1;
    /**
     * all
     */
	int ALL = 2;
    /**
     * 前缀
     */
	int PREFIX_SQL = 3;
    /**
     * 获得kvHandler的名称
     *
     * @return the name
     */
    Integer getName();

    /**
     * 扩展执行
     * @param params 参数
     * @return list
     */
    List<Map<String, Object>> extendExecute(Map<String, Object> params);

    /**
     * 通过dao执行SQL
     * @return
     */
	boolean isDaoExecute();

    /**
     * 创建SQL
     * @return SQL
     */
	String createSql(Map<String, Object> params);

    /**
     * 获取主键字段名称
     * @return 主键字段名称
     */
    String getKeyField();

    /**
     * 获取值名称
     * @return 值名称
     */
    String getValueField();

    /**
     * 获取默认值标志
     * @return 默认值标志
     */
    int getDefaultValueFlag();
}
